﻿using System.Collections.Generic;
using PPI.General;
using PPI.WebConsumer.PPI.Svc;
using System.Data;

namespace PPI.WebConsumer
{
    public class WSettings
    {
        public static DataSet SelectKml()
        {
            PPI.Svc.Service1 svc = new Service1();
            ConfigReader reader = ConfigReader.GetInstance();
            return svc.DSettings_SelectKml(reader.ConectionMode);
        }

        public static void Update(int id, string text)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            svc.DSettings_Update(id,text,reader.ConectionMode);


            
        }

        public static DataSet GetSettingByKey(string key)
        {
            PPI.Svc.Service1 svc = new Service1();
            ConfigReader reader = ConfigReader.GetInstance();
            return svc.Settings_GetByKey(key, reader.ConectionMode);
        }

        public static void UpdateSettingByKey(string key, string text, string value)
        {
            PPI.Svc.Service1 svc = new Service1();
            ConfigReader reader = ConfigReader.GetInstance();
            svc.Settings_UpdateByKey(key,text,value, reader.ConectionMode);
        }
    }
}
